<?php

/**
 * Varstring filter form base class.
 *
 * @package    seth
 * @subpackage filter
 * @author     Fuz
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseVarstringFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'dev'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Powerdev'), 'add_empty' => true)),
      'sampletime' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'source'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'sourceid'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'vdc'        => new sfWidgetFormFilterInput(),
      'idc'        => new sfWidgetFormFilterInput(),
      'idc1'       => new sfWidgetFormFilterInput(),
      'idc2'       => new sfWidgetFormFilterInput(),
      'idc3'       => new sfWidgetFormFilterInput(),
      'idc4'       => new sfWidgetFormFilterInput(),
      'idc5'       => new sfWidgetFormFilterInput(),
      'idc6'       => new sfWidgetFormFilterInput(),
      'idc7'       => new sfWidgetFormFilterInput(),
      'idc8'       => new sfWidgetFormFilterInput(),
      'idc9'       => new sfWidgetFormFilterInput(),
      'idc10'      => new sfWidgetFormFilterInput(),
      'idc11'      => new sfWidgetFormFilterInput(),
      'idc12'      => new sfWidgetFormFilterInput(),
      'idc13'      => new sfWidgetFormFilterInput(),
      'idc14'      => new sfWidgetFormFilterInput(),
      'idc15'      => new sfWidgetFormFilterInput(),
      'idc16'      => new sfWidgetFormFilterInput(),
      'idc17'      => new sfWidgetFormFilterInput(),
      'idc18'      => new sfWidgetFormFilterInput(),
      'state1'     => new sfWidgetFormFilterInput(),
      'state2'     => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'dev'        => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Powerdev'), 'column' => 'id')),
      'sampletime' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'source'     => new sfValidatorPass(array('required' => false)),
      'sourceid'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'vdc'        => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc'        => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc1'       => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc2'       => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc3'       => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc4'       => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc5'       => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc6'       => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc7'       => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc8'       => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc9'       => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc10'      => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc11'      => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc12'      => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc13'      => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc14'      => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc15'      => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc16'      => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc17'      => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'idc18'      => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'state1'     => new sfValidatorPass(array('required' => false)),
      'state2'     => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('varstring_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Varstring';
  }

  public function getFields()
  {
    return array(
      'id'         => 'Number',
      'dev'        => 'ForeignKey',
      'sampletime' => 'Date',
      'source'     => 'Text',
      'sourceid'   => 'Number',
      'vdc'        => 'Number',
      'idc'        => 'Number',
      'idc1'       => 'Number',
      'idc2'       => 'Number',
      'idc3'       => 'Number',
      'idc4'       => 'Number',
      'idc5'       => 'Number',
      'idc6'       => 'Number',
      'idc7'       => 'Number',
      'idc8'       => 'Number',
      'idc9'       => 'Number',
      'idc10'      => 'Number',
      'idc11'      => 'Number',
      'idc12'      => 'Number',
      'idc13'      => 'Number',
      'idc14'      => 'Number',
      'idc15'      => 'Number',
      'idc16'      => 'Number',
      'idc17'      => 'Number',
      'idc18'      => 'Number',
      'state1'     => 'Text',
      'state2'     => 'Text',
    );
  }
}
